
import { _decorator, Component, Node, Material, EffectAsset, Sprite, Enum } from 'cc';
const { ccclass, property, executeInEditMode, disallowMultiple } = _decorator;

enum EffectType{
    NONE=0, 
}
 
@ccclass('Materials')
@executeInEditMode
@disallowMultiple
export class Materials extends Component {
    private _effectType:EffectType = EffectType.NONE;
    @property({type:Enum(EffectType),tooltip:'Effect 类型'})
    set type(val:EffectType){
        if (this._effectType === val)return ;
        this._effectType = val;
        this._init();
    }
    get type():EffectType{return this._effectType;}

    private _effect:EffectAsset = null;
    @property({type:EffectAsset,tooltip:'Effect 文件', readonly: true})
    set effectAsset(val:EffectAsset){
        if (this._effect === val)return ;
        this._effect = val;
        this._init();
    }
    get effectAsset():EffectAsset{return this._effect;}


    private _material: Material = null;
    @property({type:Material,tooltip:'材质', readonly: true})
    set material(val:Material){
        if (this._material === val)return ;
        this._material = val;
        this._init();
    }
    get material():Material{return this._material;}

    
    private _sprite: Sprite = null;

    start () {
        // [3]
    }

    private _init() {
    }
}
